package com.kuang.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Locale;

//如果我们需要拓展springmvc,官方建议我们这么做
@Configuration  //让这个类变成一个配置类
//@EnableWebMvc   //这玩意就是导入了一个类DelegatingWebMvcConfiguration
//DelegatingWebMvcConfiguration  从容器中获取所有的webmvcconfig
public class MyMvcConfig2 implements WebMvcConfigurer {

    //视图跳转
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/kuang").setViewName("test");
    }
}


